import requests
from bs4 import BeautifulSoup
req=requests.get('https://www.baidu.com')
req.encoding='utf-8'
print(req. status_code)
print(req. encoding)
print(req. text)
print(req. content)
soup=BeautifulSoup(req.text,'lxml')
print(soup.title.string)
print(soup.select('head>title')[0].text)